<?php
/*
 *  view: billing/billing_home.php
 */
?>
<h1><?php echo lang('billing'); ?></h1>
<div style="display:table;">
    <div style="float:left; display: block; width:30%;">
        <fieldset class="ui-widget-content ui-corner-all field_filter" style=" ">
            <legend class="ui-widget-content ui-corner-all"><?= lang('filter') ?></legend>
            <form method="post" id="form-filter"  name='form-billing-filter' action="">
                <div style="display:table;" id="billing_filter">
                <label ><?= lang('date_from') ?>: </label>
                <input type="text" name="filter[date_from]" id="date_from" placeholder="<?php echo lang('date_from') ?>" class="text date_picker ui-widget-content ui-corner-all"/>
                <label ><?= lang('date_to') ?>: </label>
                <input type="text" name="filter[date_to]" id="date_to" placeholder="<?php echo lang('date_to') ?>" class="text date_picker ui-widget-content ui-corner-all"/>
                <label ><?= lang('status') ?>: </label>
                <select name="filter[status]" id="billing_status" class="text ui-widget-content ui-corner-all">
                    <option value="">---</option>
                    <?php foreach ($statuses as $status) echo " <option value=".$status->status.">".$status->status."</option>";?>
                </select>
                <label><?= lang('transaction_id') ?>: </label>
                <input type="text" name="filter[transaction_id]" id="filter_transaction_id" placeholder="<?php echo lang('transaction_id'); ?>" class="text ui-widget-content ui-corner-all"/>
                <label><?= lang('user_id') ?>: </label>
                <input type="text" name="filter[user_id]" id="filter_id" placeholder="ID" class="text ui-widget-content ui-corner-all"/>
                <br/>

                <br/>
                <label> &nbsp; </label>
                <input type="button" name="filter_billing_submit" id="filter_submit" class="ui-button ui-button-text-only ui-widget ui-state-default ui-corner-all" value="<?php echo lang('search'); ?>" />
                <input type="reset" name="filter_billing_reset" id="filter_reset" class="ui-button ui-button-text-only ui-widget ui-state-default ui-corner-all" value="<?php echo lang('reset'); ?>" />
                </div>
            </form>
        </fieldset>
    </div>
    <br/>

    <div id="billing_sum" style="display:block; float:left; margin-left: 30px;">
       <fieldset class="ui-widget-content ui-corner-all field_filter" style=" display: table;">
           <legend class="ui-widget-content ui-corner-all"><?= lang('pay_method') ?></legend>
        <label style='text-align: left; float: left; display: block; width: 100px;'><?= lang('period') ?>: </label>
        <select name="select_period" id="select_period" class="text ui-widget-content ui-corner-all" style='float: left; display: block;'>
            <option value="day"><?= lang('day') ?></option>
            <option value="week"><?= lang('week') ?></option>
            <option value="month"><?= lang('month') ?></option>
        </select>   
        <br/><br/>
        <div class="pay_method_table">
            <div class="hdiv">
               <label style="float: right;"><?= lang('sum') ?></label>
               <label style="float: right;"><?= lang('pay_method') ?></label>
            </div>
            <div>
                <img src="<?php echo base_url(); ?>img/icons/paypal.png"/>
                <label style="float: right;"> <?= lang('paypal') ?></label>
                <label style="float: right;"> <?= lang('paypal') ?></label>
             </div>
            <div>
            <label style="font-weight: bold; float: right;"><?= lang('total') ?>:  <span id="total"><? echo $total->amount;?></span></label>
            </div>
        </div>
       </fieldset>

    </div>
</div>
<br/><br/>
<table id="table_billing" width='100%' class='table_sorter' cellpadding=3px cellspacing=0>
    <thead>
    <th>ID</th>
    <th><?= lang('username') ?></th>
    <th>E-mail</th>
    <th><?= lang('amount') ?></th>
    <th><?= lang('coins') ?></th>
    <th><?= lang('time') ?></th>
    <th><?= lang('provider') ?></th>
    <th><?= lang('status') ?></th>
    <th>IP</th>
    <th><?= lang('error') ?></th>
    <th><?= lang('extra') ?></th>
</thead>
<tbody>
    <?php
    $this->load->view('billing/billing_list');
    ?>  
</tbody>
</table>
<br/>
<div id='response'></div>

<div id="dialog-user" class="hide" title="<?php echo lang('term_user'); ?>">

</div>
